<!DOCTYPE html>
<!--ctrl + shift + f9-->
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>A J 后台登录系统</title>
    <link th:href="@{/resource/favicon.ico}" rel="icon" type="image/ico">
    <link th:href="@{/resource/lightyear/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/resource/lightyear/css/materialdesignicons.min.css}" rel="stylesheet">
    <link th:href="@{/resource/lightyear/css/style.min.css}" rel="stylesheet">
    <link th:href="@{/resource/layui/css/layui.css}" rel="stylesheet">
    <script th:src="@{/resource/layui/layui.js}"></script>
    <style>
        body {
            display: -webkit-box;
            display: flex;
            -webkit-box-pack: center;
            justify-content: center;
            -webkit-box-align: center;
            align-items: center;
            height: 100%;
        }
        .login-box {
            display: table;
            table-layout: fixed;
            overflow: hidden;
            max-width: 700px;
            background-color: #fff;
        }
        .txj-logo{
            display: none;
        }
        .login-left {
            display: table-cell;
            position: relative;
            margin-bottom: 0;
            border-width: 0;
            padding: 45px;
        }
        .login-left .form-group:last-child {
            margin-bottom: 0px;
        }
        .captcha {
            width: 100%;
            height: 38px;
            display: flex;
            align-items: center;
        }
        .login-right {
            display: table-cell;
            position: relative;
            margin-bottom: 0;
            border-width: 0;
            padding: 45px;
            width: 50%;
            max-width: 50%;
            background: #67b26f!important;
            background: -moz-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            background: -webkit-linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            background: linear-gradient(45deg,#67b26f 0,#4ca2cd 100%)!important;
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#67b26f', endColorstr='#4ca2cd', GradientType=1 )!important;
        }
        .login-box .has-feedback.feedback-left .form-control {
            padding-left: 38px;
            padding-right: 12px;
        }
        .login-box .has-feedback.feedback-left .form-control-feedback {
            left: 0;
            right: auto;
            width: 38px;
            height: 38px;
            line-height: 38px;
            z-index: 4;
            color: #dcdcdc;
        }
        .login-box .has-feedback.feedback-left.row .form-control-feedback {
            left: 15px;
        }
        .title{
            height: 20px;
            margin-bottom: 15px;
            font-size: 20px;
            line-height: 20px;
            text-align: center;
        }
        @media (max-width: 576px) {
            .bg-translucent {
                height: 100%;
            }
            .login-box {
                height: 100%;
                border-radius: 5px;
            }
            .login-right {
                display: none;
            }
            .txj-logo{
                display: block;
                height: 50px;
                margin-bottom: 70px;
                font-size: 40px;
                line-height: 50px;
                text-align: center;
                font-family: "等线 Light";
            }
            .captcha img{
                width: 100%;
            }
        }
    </style>
</head>

<body style="background-image: url(/resource/jquery/img/2.jpg); background-size: cover;">
<div class="bg-translucent p-10">
    <div class="login-box clearfix">
        <div class="login-left">
            <div class="txj-logo">W Y @ A J</div>
            <div class="title">授权提示</div>
            <form id="login">
                <div class="form-group">
                    是否授权给当前服务器
                </div>
                <div class="form-group">
                    <button class="btn btn-block btn-primary" type="button" id="yes">授权</button>
                    <button class="btn btn-block btn-danger" type="button" id="no">取消</button>
                </div>
            </form>
        </div>
        <div class="login-right">
            <p>
                <img th:src="@{/resource/Logo.png}" class="m-b-md m-t-xs" style="width: 50px" alt="logo">
                <span style="padding: 0 20px;font-weight: bold;font-size: 16px" class="text-white m-tb-15">A J 后台登录</span>
            </p>
            <p class="text-white m-tb-15">A J 是一个理想性项目，制作是为了练练手，熟悉所学知识，所有内容均结合网络资源，如有侵权，请联系:
                <a href="JavaScript:13778729882;">文毅</a>
            </p>
            <p class="text-white">Copyright © 2021 <a href="http://wenyiyun.love">T X J</a>. All right reserved</p>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{/resource/lightyear/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/resource/lightyear/js/bootstrap.min.js}"></script>
<script>
    $(function () {
        $("#yes").click(function () {
            $.ajax({
                url: '/oauth/authorize',
                type: 'POST',
                data: {
                    "user_oauth_approval":true,
                    "authorize":"Authorize"
                },
                datatype:'json',
                success:function (res) {
                    if (res.status){
                        localStorage.setItem("Authorization","Bearer "+res.data.access_token);
                        // console.log(res.data);
                        location.href="/pages/index";
                    } else {
                        layer.msg(res.msg);
                    }
                }
            })
        });
        $("#no").click(function () {
            location.href = "/pages/login";
        })
        /*
        $("#no").click(function () {
            $.ajax({
                url: '/oauth/authorize',
                type: 'POST',
                data: {
                    "user_oauth_approval":false,
                    "deny":"Deny"
                },
                datatype:'json',
                success:function (res) {
                    if (res.status){
                        console.log(res.data);
                    } else {
                        layer.msg(res.msg);
                    }
                }
            })
        });
        */
    })
</script>
</body>
</html>
